POWER.Name = "Super speed";
POWER.Desc = "Lets you run fast and jump high";

POWER.Version = 1;
POWER.Author = "Brian Nevec";

function POWER:KeyPress( key )
	
	if key == IN_SPEED then
		
		GAMEMODE:SetPlayerSpeed( self.Owner, 250, 3000 );
		
	end
	
	if key == IN_JUMP && self.Owner:IsOnGround( ) then
		
		local dir = ( self.Owner:GetVelocity( ):GetNormal( ) + Vector( 0, 0, 1 ) ):GetNormal( );
		self.Owner:SetVelocity( dir * 600 );
		
	end
	
end

function POWER:KeyRelease( key )
	
	if key == IN_SPEED then
		
		GAMEMODE:SetPlayerSpeed( self.Owner, 250, 500 );
		
	end
	
end

function POWER:ScalePlayerDamage( _, info )
	
	if info:IsFallDamage( ) && self.Owner:KeyDown( IN_SPEED ) then
		
		info:SetDamage( 0 );
		
	end
	
end